#include <stdio.h>
#include <stdlib.h>

#define MAXLEN 1024

int main()
{
    char *fields = (char *)malloc(sizeof(char) * MAXLEN);
    char *parameter = (char *)malloc(sizeof(char) * MAXLEN);
    char *value = (char *)malloc(sizeof(char) * MAXLEN);
    int rs1 = 0;
    int rs2 = 0;
    int matched1 = 0;
    int matched2 = 0;

    if(fgets(fields, MAXLEN, stdin)){
        if ((rs2 = sscanf(fields, "%[^=]=\"%[^\"]\"%n", parameter, value, &matched1)) != 2 && 
                (rs1 = sscanf(fields, "%[^=]=\"\"%n", parameter, &matched2)) != 1) {
            printf("%d,%d,%d,%d\n", rs2, rs1, matched1, matched2);
            printf("you must be joking with name=value pair!\n");
        }
        else
        {
            printf("%d,%d,%d,%d\n", rs2, rs1, matched1, matched2);
            printf("%s=%s\n", parameter, value);
        }
        free(fields);
        free(parameter);
        free(value);
    }


    return 0;
}
